//
//
//
//
//
// Socks4Server.h

#ifndef SOCKS4_SERVER_H_
#define SOCKS4_SERVER_H_

#include "common.h"
#include "Mutex.h"
#include "ActiveObject.h"

class ThreadManager;
class Socks4Server : public ActiveObject
{
	public:
		static Socks4Server* Instance(U32 num);
		static void Destroy(Socks4Server*);

		virtual void Svc();
		virtual void ForceStop(void);

		void Report(std::ostream& os);
		void WaitAll(void);
		void SignalExit(void);

		static const U16 SERVER4PROXY_PORT = 5406;
	protected:
		Socks4Server(U32 num);
		~Socks4Server();

	private:
		static Socks4Server* _instance;
		static Mutex _instanceMutex;

		ThreadManager* _poolInstance;
};
#endif // SOCKS4_SERVER_H_
